/**
 * @Author Puzzle
 * @Date 2022/6/13 11:21 上午
 **/

package model

import (
	"zsc-boot/core/orm"
)

// ServiceMenu 结构体
// 如果含有time.Time 请自行import time包
type ServiceMenu struct {
	orm.Model
	Name          string        `json:"name" form:"name" gorm:"column:name;comment:菜单名称;"`
	ParentId      uint          `json:"parentId" form:"parentId" gorm:"column:parent_id;comment:上级菜单ID;"`
	Children      []ServiceMenu `json:"children" gorm:"foreignKey:ParentId"`
	MenuType      uint          `json:"menuType" form:"menuType" gorm:"column:menu_type;comment:菜单类型（1目录、2菜单、3按钮,4二级按钮）;"`
	RulePath      string        `json:"rulePath" form:"rulePath" gorm:"column:rule_path;comment:权限标识;"`
	Icon          string        `json:"icon" form:"icon" gorm:"column:icon;comment:图标;"`
	Visible       uint          `json:"visible" form:"visible" gorm:"column:visible;comment:是否隐藏(1隐藏、2不隐藏);"`
	Status        string        `json:"status" form:"status" gorm:"column:status;comment:状态(启用,停用);"`
	Sequence      uint          `json:"sequence" form:"sequence" gorm:"column:sequence;comment:排序;"`
	UrlPath       string        `json:"urlPath" form:"urlPath" gorm:"column:url_path;comment:路由地址;"`
	ComponentPath string        `json:"componentPath" form:"componentPath" gorm:"column:component_path;comment:组件路径;"`
	IsShortCut    uint          `json:"IsShortCut" form:"IsShortCut" gorm:"column:is_short_cut;comment:快捷方式(1启用、2停用);"`
	Belong        string        `json:"belong" form:"belong" gorm:"column:belong;comment:菜单属于某(大屏,后台,APP)"`
}

// TableName ServiceMenu 表名
func (ServiceMenu) TableName() string {
	return "service_menu"
}

func (ServiceMenu) TableComment() string {
	return "菜单"
}
